[Java] Cut <br/>-Tags from String end

Posted by Robert M. on Stack Overflow See other posts from Stack Overflow or by Robert M.
Published on 2011-02-16T23:14:37Z Indexed on 2011/02/16 23:25 UTC
Read the original article Hit count: 220

Filed under:
|
|
|

Hello everybody,

I am currently developing a Web-Application using Java EE where I'm using a Rich-Javascript-Editor (http://www.primefaces.org/showcase/ui/editor.jsf). As the user can easily add too many linebreaks that will be convertet to linebreak-tags, I need to remove all these Tags from the end of a String.

Is there an elegant way of using Regex to accomplish this?

An example String would be:

"This is a test <b>bold</b><br/><br/>" 

Where obviously the last two tags have to be removed.

Thank you in advance for any help

Best Regards, Robert

© Stack Overflow or respective owner

Related posts about java

Related posts about regex